import request from "@/unils/request";
// 页面二：
// 故障点根据车型id查询获取
export const getFaultById = (Id:number) => {
	return request({
		url: `/api/styledata/${Id}`,
		method: 'get',
	})
}
//获取车型
export const getStyle = () => {
	return request({
		url: '/api/styledata',
		method: 'get',
		params:{
			PageNumber:1,
			pageSize:10,
		}
	})
}
// 页面三 ：
// 故障点
// 故障点分页查询??????????????	
export const getFaultPoint = (params:any) => {
	return request({
		url: '/api/faultpoint',
		method: 'get',
		params:params
	})
}
export const getFaultPointById = (Id:number) => {
	return request({
		url: `/api/faultpoint/${Id}`,
		method: 'get',
	})
}
export const postFaultPoint = (data:any) => {
	return request({
		url: '/api/faultpoint',
		method: 'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data
	})
}
// 编辑保存故障
export const putFaultPoint = (params:any,data:any) => {
	return request({
		url: '/api/faultpoint',
		method: 'put',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		params:params,
		data:data
	})
}
// 页面四：
// 故障现象
// 获取故障现象
// export const getFaultAppearance = () => {
// 	return request({
// 		url: '/api/appearance',
// 		method: 'get',
// 		params:{
// 			PageNumber:1,
// 			pageSize:1000,
// 		}
// 	})
// }
// 查询故障现象
export const getFaultAppearance = (data:any) => {
	return request({
		url: '/api/appearance/query/style',
		method:'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data,
	})
}
// 新增故障现象
export const addFaultAppearance = (data:any) => {
	return request({
		url: '/api/appearance/add/style',
		method:'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data,
	})
}
// 删除某条故障现象
export const deleteFaultAppearance = (Id:number) => {
	return request({
		url: `/api/appearance?id=${Id}`,
		method:'delete',
	})
}
// 编辑保存故障现象
export const putFaultAppearance = (params:any,data:any) => {
	return request({
		url: '/api/appearance',
		method: 'put',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		params:params,
		data:data
	})
}
// ===========================================================================================================
// 故障码
// 故障码获取
export const getFaultCode = (data:any) => {
	return request({
		url: '/api/faultcode/query/style',
		method: 'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        data:data
	})
}
// 新增故障码
export const addFaultFaultCode = (data:any) => {
	return request({
		url: '/api/faultcode/add/style',
		method:'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data,
	})
}
// 删除某条故障码
export const deleteFaultCode = (Id:number) => {
	return request({
		url: `/api/faultcode?id=${Id}`,
		method:'delete',
	})
}
// 编辑保存故障码
export const putFaultFaultCode = (params:any,data:any) => {
	return request({
		url: '/api/faultcode',
		method: 'put',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		params:params,
		data:data
	})
}
// =======================================================================================================
// 电压测量
// 电压测量分页获取
export const getVoltage = (data:any) => {
	return request({
		url: '/api/voltage/query/style',
		method: 'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data
	})
}
// 新增电压测量
export const addVoltage = (data:any) => {
	return request({
		url: '/api/voltage/add/style',
		method:'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data,
	})
}
// 删除某条电压测量
export const deleteVoltage = (Id:number) => {
	return request({
		url: `/api/voltage?id=${Id}`,
		method:'delete',
	})
}
// 编辑保存电压测量
export const putVoltage = (params:any,data:any) => {
	return request({
		url: '/api/voltage',
		method: 'put',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		params:params,
		data:data
	})
}
// =======================================================================================================
// 电阻测量
// 电阻测量获取
export const getResistor = (data:any) => {
	return request({
		url: '/api/resistor/query/style',
		method: 'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data
	})
}
// 新增电阻检测值
export const addResistor = (data:any) => {
	return request({
		url: '/api/resistor/add/style',
		method:'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data,
	})
}
// 删除某条电阻测量
export const deleteResistor = (Id:number) => {
	return request({
		url: `/api/resistor?id=${Id}`,
		method:'delete',
	})
}
// 编辑保存电阻检测
export const putResistor = (params:any,data:any) => {
	return request({
		url: '/api/resistor',
		method: 'put',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		params:params,
		data:data
	})
}
// ===================================================================================================
// 机理分析
// 机理分析获取
export const getAnalysis = (data:any) => {
	return request({
		url: '/api/analysis/query/style',
		method: 'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data
	})
}
// 新增机理分析
export const addAnalysis = (data:any) => {
	return request({
		url: '/api/analysis/add/style',
		method:'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data:data,
	})
}
// 删除机理分析
export const deleteAnalysis = (Id:number) => {
	return request({
		url: `/api/analysis?id=${Id}`,
		method:'delete',
	})
}
// 编辑保存机理分析
export const putAnalysis = (params:any,data:any) => {
	return request({
		url: '/api/analysis',
		method: 'put',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		params:params,
		data:data
	})
}